package com.inteligencia.stage.web;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;

@ParentPackage(value = "stage")
public class Echo extends ActionSupport {

    private static final long serialVersionUID = -7133848243722723891L;
    private String echo;

    @Action(value = "/echon", results = {
        @Result(location = "echo.jsp", name = "success")
    })
    @Override
    public String execute() throws Exception {
        setEcho("Hello world ");
        System.out.println("echo aqi");
        return SUCCESS;
    }

    @Action(value = "/bienvenida", results = {
        @Result(location = "echo.jsp", name = "success")
    })
    public String ingreso() throws Exception {
        setEcho("Logeado");
        return SUCCESS;
    }

    public String getEcho() {
        return echo;
    }

    public void setEcho(String echo) {
        this.echo = echo;
    }
}
